from selenium import webdriver
from Buiness.LoginPage import LoginPage
from common.BasePage import BasePage

class Back_stagePage(BasePage):
    def __init__(self,driver=None):
        super().__init__(driver)
        self.system_manage_loc = "xpath,/html/body/div[1]/div[1]/div/ul[1]/li[8]/button/i"
        self.system_manage_frame_name="iframe-superadmin"
        self.assert_text_loc = "link text,签退"
        # self.back_stage_manage="xpath,/html/body/div[1]/div[1]/div/ul[1]/li[8]/button/i"
        # self.add_members="xpath,/html/body/div[2]/div/div/div[1]/div/a/h3"

    # def click_back(self):
    #     self.click(self.back_stage_manage)
    #     self.wait(1)
    #
    # def click_add_manage(self):
    #     self.click(self.add_members)
    #     # self.wait(1)

    def enter_system_manage(self):
        self.click(self.system_manage_loc)
        self.into_frame(self.system_manage_frame_name)
        self.wait(2)

    def get_assert_text(self):
        return self.get_ele_text(self.assert_text_loc)

    def test_back(self):
        lg=LoginPage(driver=self.driver)
        lg.test_login()
        self.enter_system_manage()

if __name__ == '__main__':
    back=Back_stagePage()
    back.test_back()
    # # 初始化浏览器驱动
    # driver = webdriver.Chrome()
    # # 实例化 LoginPage 并登录
    # lg = LoginPage(driver)
    # lg.enter_account("admin")
    # lg.enter_password("123456")
    # lg.click_login_button()
    # # 实例化 Back_stagePage 并调用方法
    # back = Back_stagePage(driver)  # 实例化 Back_stagePage
    # back.test_back()  # 正确调用实例方法